<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>相册列表</title>
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<script> 
	function change_width(img_name,wid,hei)
	{
		var CurImage=new Image();
		if(CurImage.src!=img_name.src)
		{
			CurImage.src=img_name.src;
		}
		var img_width = CurImage.width;
		var img_height = CurImage.height;
		img_name.width = img_width;
		img_name.height = img_height;

		if(img_height/hei > img_width/wid)
		{
			if( img_height > hei)
			{
				img_name.width = img_name.width/img_name.height*hei;
				img_name.height = hei;
			}
		}
		else
		{
			if( img_width > wid)
			{
				img_name.height = img_name.height/img_name.width*wid;
				img_name.width = wid;
			}
		}
		return true;
	}
</script>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a>
  <c:if test="${theForm.qryGroupID != 99999999 && theForm.qryGroupID > 0}">
   >> <a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html">部落</a>  >> 部落相册
  </c:if>
  <c:if test="${theForm.qryGroupID == 99999999 }">
   >> 相册列表
  </c:if>
  </div>
	<%@ include file="/navf.jsp"%>
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
 
  <div class="hotBox1">  
    <div class="hotBox1-left">
	<c:if test="${theForm.qryGroupID != 99999999 && theForm.qryGroupID > 0}">     
	  <a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html"><img src="${cpath}/${myfn:getGroupPic(theForm.qryGroupID)}" width="75" height="75" class="shequ user_icon_2"></a>
      <p><b><a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html">${myfn:getGroupName(theForm.qryGroupID)}</a>&nbsp;&gt;&nbsp;<a href="${cpath}/galbum.do?action=list&qryGroupID=${theForm.qryGroupID}">相册</a></b></p>
	  <p>共 ${theForm.page.totalNum} 个相册&nbsp;</p>
	</c:if>
	<c:if test="${theForm.qryGroupID == 99999999 || theForm.qryGroupID == 0}">
	  <a href="${cpath}/users_home/userID_${theForm.qryUserID}.html"><img src="${cpath}/${myfn:getUserPic(theForm.qryUserID)}" width="75" height="75" class="shequ user_icon_2"></a>
      <p><b>我的相册</b></p>
	  <p>共 ${theForm.page.totalNum} 个相册&nbsp;</p>
	</c:if>

    </div>
    <div class="hotBox1-right">
     <p align="right"><a href="javascript:history.go(-1);"><img src="/iyoulin/images/icon_32.gif" width="137" height="25" /></a></p> 
      <!-- p class="lineColor1">&nbsp;</p> -->
	  <c:if test="${theForm.qryGroupID != 99999999 && theForm.qryGroupID > 0 && myfn:groupAddFlag(theForm.qryGroupID,userID) ==  1 || 
	  theForm.qryGroupID == 99999999 && theForm.qryUserID == userID}">
	  <p><a href="${cpath}/galbum_addPage/groupID_${theForm.qryGroupID}.html"><img src="${cpath}/images/album.gif" width="177" height="58" /></a></p>    
	  </c:if>  
    </div>
  </div> 
   
  <div class="left-Box6">
  <h3>我的相册</h3>
  <div class="left-Box6-content">
		<form action="${cpath}/galbum.do" name="theForm"  method="post" enctype="multipart/form-data" >   
		  <ul class="theAlbumList2">
  			<c:forEach var="album" items="${albumlist}" varStatus="status">   
			<li>
               <p class="p1"><a href="${cpath}/gpic.do?action=adlist&qryGAlbumID=${album.galbumID}"><img src="${cpath}/${myfn:getAlbumHeadPic(album.galbumID)}" ></a>
			   </p>  
               <p class="p2">
                 <span>${fn:substring(album.albumname,0,5)}&nbsp;[${myfn:getMsg("USERSET_TYPE", album.protect)}]</span>
                 <span>共 ${album.num} 张</span>
                 <span>创建:${myfn:formatDate14(album.ctime,"-")}</span>
                 <span title ="${album.albuminfo}">介绍:${fn:substring(album.albuminfo,0,8)}。。</span>  
                 <c:if test="${album.userID == userID}">
				 <span><a href="${cpath}/galbum.do?action=modifyPage&galbumID=${album.galbumID}">编辑</a>&nbsp;&nbsp;<a href="javascript:doDel('${album.galbumID}');">删除</a></span>
				 </c:if>
              </p>    
            </li> 
			</c:forEach>            
          </ul>
    <div class="clearFloat"></div>
    
    <div class="page">
		<input type="hidden" name='qryGroupID' value='${theForm.qryGroupID}'/>
		<!-- 分页主键 formName字段当前的form名称 -->
		<%@ include file="/jsplib/page.jsp" %>
		<!--隐藏域-->
		<input type="hidden" name='action' value='list'/>
    </div>
	</form>
  </div>

</div>
  
    
    
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->

</body>
</html>
<script>
    /**
     * 检查项目资料维护
     */
	function doConfirm()
	{
		var form = document.theForm;

		var action = form['action'];

		form.submit();
	}
    /**
     * 检查项目资料维护
     */
	function doDel(id)
	{
		if(confirm("删除相册及所有照片， 删除不可恢复，是否继续？")){

			window.location.href = "${cpath}/galbum.do?action=delete&galbumID=" + id;
		}
	}
</script>
